//index.js
//获取应用实例
const app = getApp()

Page({
  data: {
    weather: { 'wea_img': 'qing'},//实况天气
    weatherweek:[],//七日天气
  },

  onLoad: function () {
    this.getapi();
  },

  getapi:function(){
    var _this = this;
    // 获取IP地址, 请更换为自己的appid和appsecret
    wx.request({
      url: 'https://tianqiapi.com/api?version=v1&appid=61864826&appsecret=vGXMyRZ4',
      data: {
      },
      method: 'POST',
      header: {
        'content-type': 'application/x-www-form-urlencoded'
      },
      success: function (res) {
        _this.setData({
          weatherweek: res.data
        });
        console.log(_this.data.weatherweek)
      }
    });
  },
  
})
